home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyc (Python 2.6)
-
-
- try:
- from zope.interface import Interface, classImplements, implements
- except ImportError:
-
- class Interface(object):
- pass
-
-
- def classImplements(c, i):
- pass
-
-
- def implements(*args):
- pass
-
-
- from rdflib import RDF
-
- class IGraph(Interface):
- ''' An rdflib.Graph indexes data expressed in the Resource Description
- Framework (RDF). Any kind of content, whether inside Zope or from
- some outside source, can be cataloged if it can describe itself
- using the RDF standard. Any kind of RDF vocabulary like RSS, OWL,
- DAML+OIL, Dublin Core, or any kind of XML schema or data can be
- expressed into the graph.
-
- Once data is graphed it can be queried using either the Python
- query interface, a TALES-based RDF query expression language, or
- the sparql rdf query language. Results of a query can be either a
- generator of result records or RDF in xml or NT format.
-
- In Semantic Web terms, a graph is a persistent triple store. RDF
- is broken down into subject, predicate, and object relations
- (called triples) and each relation is indexed. The triple store
- can then be queried for triples that match patterns.
- '''
-
- def parse(rdf, format = 'xml'):
- ''' Parse RDF-XML into the catalog. '''
- pass
-
-
- def add(.0):
- ''' Add one triple to the catalog. '''
- (subject, predicate, object) = .0
-
-
- def remove(.0):
- ''' Remove one triple from the catalog. '''
- (subject, predicate, object) = .0
-
-
- def triples(.0, *args):
- ''' Query the triple store. '''
- (subject, predicate, object) = .0
-
-
- def contexts(triple = None):
- ''' Generator over all contexts in the graph. If triple is
- specified, a generator over all contexts the triple is in.'''
- pass
-
-
- def value(subject, predicate = RDF.value, object = None, default = None, any = False):
- """ Get a value for a subject/predicate, predicate/object, or
- subject/object pair -- exactly one of subject, predicate,
- object must be None. Useful if one knows that there may only
- be one value.
-
- It is one of those situations that occur a lot, hence this
- 'macro' like utility
-
- Parameters:
- -----------
- subject, predicate, object -- exactly one must be None
- default -- value to be returned if no values found
- any -- if True:
- return any value in the case there is more than one
- else:
- raise UniquenessError
- """
- pass
-
-
- def label(subject, default = ''):
- ''' Queries for the RDFS.label of the subject, returns default
- if no label exists.'''
- pass
-
-
- def comment(subject, default = ''):
- ''' Queries for the RDFS.comment of the subject, returns
- default if no comment exists.'''
- pass
-
-
- def items(list):
- '''Generator over all items in the resource specified by list
- (an RDF collection)'''
- pass
-
-
- def __iter__():
- ''' Iterates over all triples in the store.'''
- pass
-
-
- def __contains__(triple):
- """ Support for 'triple in graph' syntax."""
- pass
-
-
- def __len__(context = None):
- ''' Returns the number of triples in the graph. If context is
- specified then the number of triples in the context is
- returned instead.'''
- pass
-
-
- def __eq__(other):
- ''' Test if Graph is exactly equal to Graph other.'''
- pass
-
-
- def __iadd__(other):
- ''' Add all triples in Graph other to Graph.'''
- pass
-
-
- def __isub__(other):
- ''' Subtract all triples in Graph other from Graph.'''
- pass
-
-
- def subjects(predicate = None, object = None):
- ''' A generator of subjects with the given predicate and
- object.'''
- pass
-
-
- def predicates(subject = None, object = None):
- ''' A generator of predicates with the given subject and
- object.'''
- pass
-
-
- def objects(subject = None, predicate = None):
- ''' A generator of objects with the given subject and
- predicate.'''
- pass
-
-
- def subject_predicates(object = None):
- ''' A generator of (subject, predicate) tuples for the given
- object'''
- pass
-
-
- def subject_objects(predicate = None):
- ''' A generator of (subject, object) tuples for the given
- predicate'''
- pass
-
-
- def predicate_objects(subject = None):
- ''' A generator of (predicate, object) tuples for the given
- subject'''
- pass
-
-
- def get_context(identifier):
- ''' Returns a Context graph for the given identifier, which
- must be a URIRef or BNode.'''
- pass
-
-
- def remove_context(identifier):
- ''' Removes the given context from the graph. '''
- pass
-
-
- def transitive_objects(subject, property, remember = None):
- ''' '''
- pass
-
-
- def transitive_subjects(predicate, object, remember = None):
- ''' '''
- pass
-
-
- def load(location, publicID = None, format = 'xml'):
- ''' for b/w compat. See parse.'''
- pass
-
-
- def save(location, format = 'xml', base = None, encoding = None):
- ''' for b/x compat. See serialize.'''
- pass
-
-
- def context_id(uri):
- pass
-
-
- def parse(source, publicID = None, format = 'xml'):
- """ Parse source into Graph. If Graph is context-aware it'll
- get loaded into it's own context (sub graph). Format defaults
- to xml (AKA rdf/xml). The publicID argument is for specifying
- the logical URI for the case that it's different from the
- physical source URI. Returns the context into which the source
- was parsed."""
- pass
-
-
- def serialize(destination = None, format = 'xml', base = None, encoding = None):
- ''' Serialize the Graph to destination. If destination is None
- serialize method returns the serialization as a string. Format
- defaults to xml (AKA rdf/xml).'''
- pass
-
-
- def seq(subject):
- '''
- Check if subject is an rdf:Seq. If yes, it returns a Seq
- class instance, None otherwise.
- '''
- pass
-
-
- def absolutize(uri, defrag = 1):
- """ Will turn uri into an absolute URI if it's not one already. """
- pass
-
-
- def bind(prefix, namespace, override = True):
- '''Bind prefix to namespace. If override is True will bind
- namespace to given prefix if namespace was already bound to a
- different prefix.'''
- pass
-
-
- def namespaces():
- '''Generator over all the prefix, namespace tuples.
- '''
- pass
-
-
-
- class IIdentifier(Interface):
-
- def n3():
- ''' Return N3 representation of identifier. '''
- pass
-
-
- def startswith(string):
- ''' dummy. '''
- pass
-
-
- def __cmp__(other):
- ''' dummy. '''
- pass
-
-
-